import React from 'react'
import ReactDOM from 'react-dom'

const title = <h1>类组件的状态</h1>

// 定义一个类组件
class Com2 extends React.Component {
  constructor () {
    this.state = {
      count: 0
    }
  }
  //   state = {
  //     count: 0
  //   }

  render () {
    return <div>第一个类组件{this.state.count}</div>
  }
}

const content = (
  <div>
    {title}
    <hr />
    {<Com2 />}
  </div>
)

ReactDOM.render(content, document.getElementById('root'))
